import 'dart:typed_data';

import 'package:bluetooth_protocols_parser_plugin/src/tools/utils.dart';

// 响应数据基类
abstract class ResponseDataBase {
  Uint8List get data;
  int get code;
  bool get isSuccess;

  @override
  String toString() {
    return 'ResponseDataBase{code: $code, isSuccess: $isSuccess, data: ${data.toList()}}';
  }

  // 将响应数据转换为文本
  String get data2Text => Utils.uint8List2Text(data);
}
